home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- Newsgroups: comp.lang.c
- Subject: Re: int main() vs int main(void)
- Message-ID: <danpop.823791491@rscernix>
- From: danpop@mail.cern.ch (Dan Pop)
- Date: 8 Feb 96 14:58:11 GMT
- References: <1996Feb7.201848.18734@atlas.tntech.edu>
- Organization: Air Force Flight Test Center
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <1996Feb7.201848.18734@atlas.tntech.edu> jad7084@tntech.edu (Jim Davis) writes:
-
- >Okay, void main() is naughty, but there's something else I've been
- >wondering about, and I can't find it in the FAQ.
- >
- >Is there a difference between
- >
- > int main()
- > int main(void)
- >
- >? () is equivalent to (void), right? Does it matter? Am I worried about
- >nothing?
-
- As part of a function definition, the two forms are 100% equivalent.
-
- As function declarations, the second is a prototype while the first
- allows main to be called with any (number and type of) arguments.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-